<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PesonMedicationsForm.aspx.cs" Inherits="Meditek.UI.PesonMedicationsForm" MasterPageFile="~/MasterPage.Master"%>

<%@ Register Assembly="Microsoft.Practices.EnterpriseLibrary.Validation.Integration.AspNet"
    Namespace="Microsoft.Practices.EnterpriseLibrary.Validation.Integration.AspNet"
    TagPrefix="cc1" %>
<asp:Content ID="Content2" ContentPlaceHolderID="Body" runat="server">
<br />
  <asp:FormView ID="EditFormView" runat="server" DefaultMode= "Insert" DataSourceID="PesonMedicationsDataSource"
	oniteminserting="EditFormView_ItemInserting"  onitemupdating="EditFormView_ItemUpdating" BackColor="#284775" ForeColor="WhiteSmoke" >
	<EditItemTemplate> 
    <table>

	  <tr>
        <td><asp:Label ID="lblidPersonMedicationDisplay" runat="server" Text="id Person Medication :" /></td> 
		<td>
		  <asp:TextBox ID="txtidPersonMedication" runat="server" Text='<%# Bind("idPersonMedication") %>'
			ReadOnly="true"
			Width = "70px" 
			TextMode="SingleLine"
			/>
			<br />
            <cc1:PropertyProxyValidator ID="idPersonMedicationValidator" runat="server" ControlToValidate="txtidPersonMedication"
               PropertyName="idPersonMedication" SourceTypeName="Meditek.Entities.PesonMedications"></cc1:PropertyProxyValidator>
	    </td>
      </tr>
	  <tr>
        <td><asp:Label ID="lblEndDateDisplay" runat="server" Text="End Date :" /></td> 
		<td>
		  <asp:TextBox ID="txtEndDate" runat="server" Text='<%# Bind("EndDate") %>'
			Width = "210px" 
			TextMode="SingleLine"
			/>
			<br />
            <cc1:PropertyProxyValidator ID="endDateValidator" runat="server" ControlToValidate="txtEndDate"
               PropertyName="EndDate" SourceTypeName="Meditek.Entities.PesonMedications"></cc1:PropertyProxyValidator>
	    </td>
      </tr>
	  <tr>
        <td><asp:Label ID="lblHowManyDisplay" runat="server" Text="How Many :" /></td>
        <td>
          <asp:DropDownList ID="drlstHowMany" runat="server"	SelectedValue='<%# Bind("HowMany") %>'	Width="100%"
			ondatabinding="drlstHowMany_DataBinding" AppendDataBoundItems="True">
		      <asp:ListItem Text="(None)" Value="" Selected="True" />
          </asp:DropDownList>
          <br />
          <cc1:PropertyProxyValidator ID="howManyValidator" runat="server" ControlToValidate="drlstHowMany"
             PropertyName="HowMany" SourceTypeName="Meditek.Entities.PesonMedications"></cc1:PropertyProxyValidator>
        </td>
      </tr>
	  <tr>
        <td><asp:Label ID="lblHowOftenDisplay" runat="server" Text="How Often :" /></td> 
		<td>
		  <asp:TextBox ID="txtHowOften" runat="server" Text='<%# Bind("HowOften") %>'
			Width = "210px" 
			TextMode="SingleLine"
			/>
			<br />
            <cc1:PropertyProxyValidator ID="howOftenValidator" runat="server" ControlToValidate="txtHowOften"
               PropertyName="HowOften" SourceTypeName="Meditek.Entities.PesonMedications"></cc1:PropertyProxyValidator>
	    </td>
      </tr>
	  <tr>
        <td><asp:Label ID="lblMedicationDisplay"	runat="server"	Text="Name :" /></td>
        <td>
          <asp:DropDownList ID="drlstMedication" runat="server"	SelectedValue='<%# Bind("Medication") %>'	Width="100%"
			ondatabinding="drlstMedication_DataBinding" AppendDataBoundItems="True">
		      <asp:ListItem Text="(None)" Value="" Selected="True" />
		  </asp:DropDownList>
		  <br />
          <cc1:PropertyProxyValidator ID="medicationValidator" runat="server" ControlToValidate="drlstMedication"
             PropertyName="Medication" SourceTypeName="Meditek.Entities.PesonMedications"></cc1:PropertyProxyValidator>
        </td>
      </tr>	
	  <tr>
        <td><asp:Label ID="lblObsDisplay" runat="server" Text="Obs :" /></td> 
		<td>
		  <asp:TextBox ID="txtObs" runat="server" Text='<%# Bind("Obs") %>'
			Width = "210px" 
			TextMode="SingleLine"
			/>
			<br />
            <cc1:PropertyProxyValidator ID="obsValidator" runat="server" ControlToValidate="txtObs"
               PropertyName="Obs" SourceTypeName="Meditek.Entities.PesonMedications"></cc1:PropertyProxyValidator>
	    </td>
      </tr>
	  <tr>
        <td><asp:Label ID="lblPersonDisplay"	runat="server"	Text="idPerson :" /></td>
        <td>
          <asp:DropDownList ID="drlstPerson" runat="server"	SelectedValue='<%# Bind("Person") %>'	Width="100%"
			ondatabinding="drlstPerson_DataBinding" AppendDataBoundItems="True">
		      <asp:ListItem Text="(None)" Value="" Selected="True" />
		  </asp:DropDownList>
		  <br />
          <cc1:PropertyProxyValidator ID="personValidator" runat="server" ControlToValidate="drlstPerson"
             PropertyName="Person" SourceTypeName="Meditek.Entities.PesonMedications"></cc1:PropertyProxyValidator>
        </td>
      </tr>	
	  <tr>
        <td><asp:Label ID="lblStarDateDisplay" runat="server" Text="Star Date :" /></td> 
		<td>
		  <asp:TextBox ID="txtStarDate" runat="server" Text='<%# Bind("StarDate") %>'
			Width = "210px" 
			TextMode="SingleLine"
			/>
			<br />
            <cc1:PropertyProxyValidator ID="starDateValidator" runat="server" ControlToValidate="txtStarDate"
               PropertyName="StarDate" SourceTypeName="Meditek.Entities.PesonMedications"></cc1:PropertyProxyValidator>
	    </td>
      </tr>
	  <tr>
        <td><asp:Label ID="lblStatusDisplay"	runat="server"	Text="Name :" /></td>
        <td>
          <asp:DropDownList ID="drlstStatus" runat="server"	SelectedValue='<%# Bind("Status") %>'	Width="100%"
			ondatabinding="drlstStatus_DataBinding" AppendDataBoundItems="True">
		      <asp:ListItem Text="(None)" Value="" Selected="True" />
		  </asp:DropDownList>
		  <br />
          <cc1:PropertyProxyValidator ID="statusValidator" runat="server" ControlToValidate="drlstStatus"
             PropertyName="Status" SourceTypeName="Meditek.Entities.PesonMedications"></cc1:PropertyProxyValidator>
        </td>
      </tr>	
	</table>
	</EditItemTemplate>
	<EmptyDataTemplate>
		<b>PesonMedications not found..!</b>
	</EmptyDataTemplate>
	<FooterTemplate>
	  <table>
		<tr>
		  <td><asp:Button ID="btnSave" runat="server"   CausesValidation="True"	CommandName="Insert" Text="Save" CssClass="Button" /></td>
 		  <td><asp:Button ID="btnUpdate" runat="server" CausesValidation="True"  CommandName="Update" Text="Save" CssClass="Button" /></td>
		  <td><asp:Button ID="btnCancel" runat="server" CausesValidation="False" CommandName="Cancel" Text="Go To PesonMedications List" PostBackUrl="PesonMedicationsList.aspx" CssClass="Button" /></td>
        </tr>
	  </table>
	</FooterTemplate>
    </asp:FormView>
	<asp:ObjectDataSource ID="PesonMedicationsDataSource" runat="server" 
         SelectMethod="GetById" TypeName="Meditek.UI.PesonMedicationsReference.PesonMedicationsServiceClient" 
         DataObjectTypeName="Meditek.Entities.PesonMedications" InsertMethod="Insert"  UpdateMethod="Update"
         oninserted="PesonMedicationsDataSource_CommitChanges" onupdated="PesonMedicationsDataSource_CommitChanges"
         onobjectcreated="PesonMedicationsDataSource_ObjectCreated" >
            <SelectParameters>
                <asp:QueryStringParameter Name="idPersonMedication" QueryStringField="idPersonMedication" />
            </SelectParameters>
    </asp:ObjectDataSource>
  </asp:Content>    
